import { post, get, del } from "@/request";
/**
 * @PostMapping(value = "streamMessage", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
    public Flux<ChatResponse> streamMessage(@RequestBody ChatVO request) {

       return chatService.streamMessage(request);
    }
 */
export const streamMessage = async (request: any): Promise<ReadableStream> => {
  return post<ReadableStream>("/streamMessage", request);
};
export function getChatList(params: any) {
  return get<any>(`/list?sessionId=${params}`);
}
export const getRoomChatMessageList = (params: any): Promise<any> => {
  return get<any>(`/roomChat/${params}`);
};
export const sendRoomChatMessage = async (
  request: any
): Promise<ReadableStream> => {
  return post<ReadableStream>("/sendRoomChatMessage", request);
};
export const clearMessageList = (data: any) => del<null>(`/clear/${data}`);
export const removeMessage = (sessionId: any, messageId: any) =>
  del<null>(`/remove/${sessionId}/${messageId}`);
